using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using UwinEducation.Application.Dtos.Orders;
using UwinEducation.Shared.Models;

namespace UwinEducation.Application.Common.Interfaces.Orders
{
    /// <summary>
    /// 订单折扣服务接口
    /// </summary>
    public interface IOrderDiscountService
    {
        /// <summary>
        /// 根据ID获取订单折扣
        /// </summary>
        /// <param name="id">折扣ID</param>
        /// <returns>订单折扣DTO</returns>
        Task<OrderDiscountDto> GetByIdAsync(Guid id);

        /// <summary>
        /// 根据订单ID获取所有折扣
        /// </summary>
        /// <param name="orderId">订单ID</param>
        /// <returns>订单折扣DTO列表</returns>
        Task<List<OrderDiscountDto>> GetByOrderIdAsync(Guid orderId);

        /// <summary>
        /// 获取分页的订单折扣列表
        /// </summary>
        /// <param name="pageRequest">分页请求参数</param>
        /// <returns>分页结果</returns>
        Task<PagedResult<OrderDiscountDto>> GetPagedListAsync(OrderDiscountPageRequest pageRequest);

        /// <summary>
        /// 创建订单折扣
        /// </summary>
        /// <param name="createDto">创建订单折扣DTO</param>
        /// <returns>创建的订单折扣DTO</returns>
        Task<OrderDiscountDto> CreateAsync(CreateOrderDiscountDto createDto);

        /// <summary>
        /// 批量创建订单折扣
        /// </summary>
        /// <param name="createDtos">创建订单折扣DTO列表</param>
        /// <returns>创建的订单折扣DTO列表</returns>
        Task<List<OrderDiscountDto>> CreateRangeAsync(List<CreateOrderDiscountDto> createDtos);

        /// <summary>
        /// 更新订单折扣
        /// </summary>
        /// <param name="updateDto">更新订单折扣DTO</param>
        /// <returns>更新后的订单折扣DTO</returns>
        Task<OrderDiscountDto> UpdateAsync(UpdateOrderDiscountDto updateDto);

        /// <summary>
        /// 删除订单折扣
        /// </summary>
        /// <param name="id">折扣ID</param>
        /// <returns>操作结果</returns>
        Task DeleteAsync(Guid id);

        /// <summary>
        /// 批量删除订单折扣
        /// </summary>
        /// <param name="ids">折扣ID列表</param>
        /// <returns>操作结果</returns>
        Task DeleteRangeAsync(List<Guid> ids);

        /// <summary>
        /// 计算订单总折扣金额
        /// </summary>
        /// <param name="orderId">订单ID</param>
        /// <returns>总折扣金额</returns>
        Task<decimal> CalculateTotalDiscountAsync(Guid orderId);
    }
} 